package com.qianduo.struts.action;

import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

import com.qianduo.service.impl.QianduoOrderServiceImpl;
import com.qianduo.struts.AbstractAction;
import com.qianduo.util.Constants;
import com.qianduo.vo.QianduoOrderForm;

import common.page.PageList;
import common.page.Pagination;

public class QianduoOrderAction extends AbstractAction {
	public ActionForward addOrder(ActionMapping mapping,ActionForm form,HttpServletRequest req,HttpServletResponse res){
		//QianduoOrderForm qianduoOrderForm = (QianduoOrderForm) form;
		return mapping.findForward("addOrder");
	}
	public ActionForward listOrder(ActionMapping mapping,ActionForm form,HttpServletRequest req,HttpServletResponse res){
		try{
			//QianduoOrderForm qianduoAgencyForm	= (QianduoOrderForm)form;
			QianduoOrderServiceImpl service	= (QianduoOrderServiceImpl)getBean("qianduoOrderService");
			PageList pageList	= Pagination.getPageList(req);
			List<QianduoOrderForm> list	= service.listOrder(null, null, null, null, null, null, null, null, null, null, null, null, null, null, pageList);
			
			req.setAttribute("list", list);
		}catch(Exception e){
			Constants.log.error(className+" listOrder",e);
		}
		return mapping.findForward("listOrder");
	}
	
	public ActionForward saveOrUpdateOrder(ActionMapping mapping,ActionForm form,HttpServletRequest req,HttpServletResponse res){
		//QianduoOrderForm qianduoOrderForm = (QianduoOrderForm) form;
		return mapping.findForward("success");
	}
}
